package org.wmq.skyserver.controller.admin;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.wmq.skycommon.pojo.entity.Result;
import org.wmq.skyserver.service.ShopService;

@RestController("adminShopController")
@RequestMapping("/admin/shop")
public class ShopController {
    @Autowired
    private ShopService shopService;

    @PutMapping("/{status}/{id}")
    @ApiOperation("设置店铺营业状态")
    public Result setStatus(@PathVariable Integer status,
                            @PathVariable Long id){
        this.shopService.setStatus(status,id);
        return Result.success();
    }

    @GetMapping("/{id}")
    public Result getStatus(@PathVariable Long id){
        return Result.success(this.shopService.getStatus(id));
    }
}
